module Image
  extend ActiveSupport::Concern

  def img_url
  	path = "/uploads/#{self.class.name.underscore}/imgs/#{self.id}/".freeze
  	if  File.exist? path
  		Rails.logger.info "zaizaizai" * 300
    		"#{path}logo.png".freeze
    	else
    		# "http://ojnzzmype.bkt.clouddn.com//uploads/store/1/store_product/1/9c4672303c9d1821a874675de81b89a894d808c878fdb21d6da828f8a69e5988.webwxgetmsgimg (2).jpg"
    		""
    	end
  end

end
